package org.openkanban.server.service.impl;

import java.util.List;

import org.openkanban.server.dao.BoardDao;
import org.openkanban.server.domain.Activity;
import org.openkanban.server.domain.Board;
import org.openkanban.server.domain.User;
import org.openkanban.server.service.BoardService;
import org.openkanban.shared.util.StatusCodes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * standard service implementation of {@code BoardService}
 */
@Service
public class BoardServiceDefaultImpl implements BoardService {

    @Autowired
    private BoardDao boardDao;

    @Override
    public Board getBoardById(Long boardId) {
	return boardDao.getBoardById(boardId);
    }

    @Override
    public List<Board> getAll() {
	return boardDao.getAll();
    }

    @Override
    public Board createBoard(Board board, Long userId) {
	return boardDao.createBoard(board, userId);
    }

    @Override
    public Activity addActivityToBoard(Long parentBoardId, Activity newActivity) {
	return boardDao.addActivityToBoard(parentBoardId, newActivity);
    }

    @Override
    public Board removeBoard(Board board) {
	return boardDao.removeBoard(board);
    }

    @Override
    public Board updateBoard(Board board) {
	return boardDao.updateBoard(board);
    }

    @Override
    public StatusCodes addContactToBoard(Long parentBoardId, User newUser) {
	return boardDao.addContactToBoard(parentBoardId, newUser);
    }

    public void setBoardDao(BoardDao boardDao) {
	this.boardDao = boardDao;
    }

    @Override
    public StatusCodes removeContactFromBoard(Long parentBoardId, Long userId) {
	return boardDao.removeContactFromBoard(parentBoardId, userId);
    }

    @Override
    public Board getBoardByActivityIdLong(Long parentActivityId) {
	return boardDao.getBoardByActivityId(parentActivityId);
    }

    @Override
    public Board getDefaultBoardByUserId(Long userId) {
	return boardDao.getDefaultBoardByUserId(userId);
    }

    @Override
    public Long getNextBoardId(Long currentBoardId, Long userId) {
	return boardDao.getNextBoardId(currentBoardId, userId);
    }

    @Override
    public Long getPriorBoardId(Long currentBoardId, Long userId) {
	return boardDao.getPriorBoardId(currentBoardId, userId);
    }

}
